From 2eba51e4775d95118b95bebc55c4ec028afb340b Mon Sep 17 00:00:00 2001 From: parkrrrr Date: Wed, 17 May 2006 19:03:45 +0000 Subject: [PATCH] More verbose documentation git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@2067 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/filter_skeleton.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/gpsbabel/filter_skeleton.c b/gpsbabel/filter_skeleton.c index 14bb2b02c..c3bea6390 100644 --- a/gpsbabel/filter_skeleton.c +++ b/gpsbabel/filter_skeleton.c @@ -47,8 +47,14 @@ arglist_t filter_skeleton_args[] = { *******************************************************************************/ static void -filter_skeleton_init(const char *args) /* optional. If not needed, delete and replace entry in vecs with NULL */ +filter_skeleton_init(const char *args) { + /* Called before filter processing */ + + /* optional. If not needed, delete and replace entry in vecs with NULL */ + + /* This may be used to parse filter options, allocate memory, and do other + * housekeeping that should be done before filtering */ } static void @@ -61,8 +67,29 @@ filter_skeleton_process(void) /* this procedure must be present in vecs */ } static void -filter_skeleton_deinit(void) /* optional. If not needed, delete and replace entry in vecs with NULL*/ +filter_skeleton_deinit(void) { + /* called after filter processing */ + + /* optional. If not needed, delete and replace entry in vecs with NULL */ + + /* This should be used to clean up any memory allocations that are no longer + * needed after the filter terminates. */ +} + +static void +filter_skeleton_exit(void) +{ + /* called on program exit */ + + /* optional. If not needed, delete and replace entry in vecs with NULL */ + + /* You should not need this for simple filters, but it may be used to + * clean up memory allocations that must persist from one invocation of + * your filter to the next (for example, the stack in the stack filter.) + * Note that this member will be called even if your filter has not been + * used, so it *cannot* assume that _init or _process has been called + * previously. */ } /*******************************************************************************/ @@ -71,7 +98,7 @@ filter_vecs_t filter_skeleton_vecs = { filter_skeleton_init, filter_skeleton_process, filter_skeleton_deinit, - NULL, + filter_skeleton_exit, filter_skeleton_args }; -- 2.30.2